package extendsconstructor;

public class Student {
    private String name;
    private int age;
    private String school;

    public Student()
    {

    }

    public Student(String name, int age)
    {
        //this调用兄弟构造器
    	this(name, age,"二中");
    }

    public Student(String name, int age, String school)
    {
    	this.name = name;
    	this.age = age;
    	this.school = school;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    // 重写toString方法
    @Override
    public String toString()
    {
    	return "姓名：" + name + " 年龄：" + age + " 学校：" + school;
    }
}
